home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
basic
/
bmw2.zip
/
BMW.DOC
< prev
next >
Wrap
Text File
|
1989-02-19
|
12KB
|
268 lines
BMW.EXE - Bar Menu Writer for QuickBASIC 4
Copyright 1989 - Lloyd Doering - All rights reserved
BMW.EXE is a utility for QuickBASIC programmers. It's purpose is to read
and input file you've prepared (in ASCII format) and translate that into
the hundreds of lines of source code needed to make a BAR MENU. BMW.EXE
also generates Batch Files that will build standard libraries and quick
libraries for you.
1. Getting started:
Copy all of the files from you received with BMW.EXE into a new directory.
Since BMW.EXE will create new files in this directory as we proceed, we
don't want to risk writing over some of your files. That's why you want to
run BMW.EXE in an empty directory until you become familiar with what it
produces. Next, put a copy of QB.LIB, distributed with QuickBASIC in the
current directory. Run the batch file QBLIB.BAT to create QBLIB.QLB and
QBLIB.LIB. QBLIB.BAT extracts a copy of INTRPT.OBJ from QB.LIB so it can
be used to build QBLIB.LIB and QBLIB.QLB. Ignore LIB warning U4156,
"output-library specification ignored". It is a meaningless error in this
particular situation and is no cause for alarm.
2. Create an input file for BMW.EXE
Normally, this is something you would do with your word processor. But to
familiarize you with the format of an input file that is digestible by
BMW.EXE we will let BMW make an input file for us.
Type BMW C <enter>
You will now find the file SAMPLE.WIN in the current directory. At this point
you might want to print a copy of it or at least look at it. As you can see
it is a very short file.
Type BMW H <enter>
Read the description of an input file for BMW.EXE and compare it with the
file SAMPLE.WIN.
When you are ready...
Type BMW SAMPLE <enter>
BMW.EXE will now read and digest SAMPLE.WIN and 'RUN'it. You can experiment
with the menus' frame style by appending a 1, 2, 3, or 4 to this entry,
as follows;
Type BMW SAMPLE 1 <enter> {1 is the default, no real point in specifying it}
Type BMW SAMPLE 2 <enter>
Type BMW SAMPLE 3 <enter>
Type BMW SAMPLE 4 <enter>
3. Generate Source Code for QuicBASIC
Type BMW SAMPLE W <enter>
BMW will now write source code for QuickBASIC. And it will also generate some
Batch files that will direct LINK.EXE and LIB.EXE and BC.EXE to create the
libraries you will need to use this source code. And, if the program TEST.BAS
is in the current directory, these batch files will also produce TEST.EXE to
test run the created source code at full speed. With the input files
SAMPLE.WIN, BMW will create BARFEVSR.BAS. You can load BARFEVSR.BAS into
QuickBASIC and run it using the command line;
QB BARFEVSR /L QBLIB
When BMW is finished, you can run these batch files:
a. BARBCOM.BAT - run this batch file to create BARMENU.LIB and to compile
TEST.BAS using BCOM45.LIB
b. BARBRUN.BAT - run this batch file to create BARMENU.LIB and to compile
TEST.BAS using BRUN45.LIB
c. BARQLB.BAT - run this batch file to create BARMENU.QLB
BARMENU.LIB is what you will use to create EXE files. BARMENU.QLB is
all the code used to make the Menus in a Quick Library. You use
BARMENU.QLB with a command line like;
QB TEST /L BARMENU
(If you are using an earlier version of QuickBASIC, you will have to
patch these batch files so that they specify the proper Libraries.)
4. Notes
The above step assume you are using your environment variables PATH and LIB.
If you are not, you can save yourself a lot of work by doing so. You will
find information on environment variables in your DOS and QuickBASIC manuals.
The PATH environement variable tells DOS where to find BAT, COM, and EXE
files when they are not in the directory you are working in. The LIB
environment tells programs like LINK.EXE and LIB.EXE where to find LIB files
when they are not in the current directory. If you are not using these two
environment variables then the batch files produced by BMW.EXE will not work
unless you put ALL the files you need in the directory you are working in.
You can set your environment variables from your AUTOEXEC.BAT file. Also,
you may want to investigate the environement variable 'INCLUDE'.
If you haven't already, put the statement 'FILES=20' in your CONFIG.SYS file.
BMW opens several files, and if it generates an error that says
'Too many files' this is the way to fix that problem.
Read the program TEST.BAS to examine the behavior of the subroutine
'BAR' and other subroutines created by BMW.EXE.
5. History and related information
This is version 2.0 of BMW.EXE. Error trapping has been expanded over version
1.0 and line 25 is now used for Dropmenu explanatory remarks. You will have
to patch the Strings that describe the menu selection.
The source code to BMW.EXE was started in QuickBASIC, version 4.0 and ported
to version 4.5 without change. The source code to BMW.EXE is available for
$35.00. The source code to BMW.EXE (BMW.BAS) is not public domain or
shareware, and those who purchase it would be expected to use it for their
own private or buisness purposes, and not to distribute it, modified or
unmodified, under any circumstances.
Improvements and enhancements to BMW.EXE are underway. Currently I am adding
Microsoft Mouse Compatible code to the output generated by BMW.EXE, and some
additional features. Users of BMW.EXE who would like to receive notice when
this work is complete can register for $5.00. Customized versions of BMW.EXE
can be ordered. Send a printed copy of whatever changes you would like
in the code produced by BMW, register for $5.00, and I'll send you the
price tag. Use a highlighter to document the changed or additional code.
Later versions of BMW.EXE will be available to registered users for $10.00
or $5.00 if you provide the disk, mailer, and postage.
Author: Lloyd Doering
3714 Stephens Rd N.E. #28
Cleveland, TN
37312
6. Other information
The object files included with BMW.EXE are listed below.
APRINT.OBJ - Attribute Print, writes strings directly to video ram
The syntax for APRINT is
APRINT StringToPrint$, Attribute%
or
CALL APRINT(StringToPrint$, Attribute%)
where Attribute specifys the foreground, background
combination.
CURSOR.OBJ - Locates the cursor, just like Basic's LOCATE statement. The
difference is this: If VIEW PRINT has been used to limit the
cursors travels around the screen, and you call BAR knowing
that it needs to print on those lines, then you'll have an
error. What this means is you have to make sure you set
VIEW PRINT 1 TO whatever before you call BAR. If this get's
to be an inconvenience, you can replace all the LOCATE
statements in the code produced by BAR with CURSOR. The syntax
is CURSOR Row%, Column% - or - CALL CURSOR(Row%, Column%).
CURSOR ignores any VIEW PRINT statements that may be in
effect and locates the cursor anyway. CURSOR is a tad slower
than BASIC's LOCATE, even though it's written in assembly.
Cursor makes two BIOS calls to do it's job.
BLOCKMOV.OBJ- Moves blocks of memory around for QuickBASIC. Given a source
and destination Segment/Offset and number of words to move,
moves the contents of memory from the source to the destination.
Used to save and restore the screen.
The syntax for BLOCKMOVE is;
BLOCKMOVE SSEG%, SOFF%, DSEG%, DOFF%, WordsToMove%
or
CALL BLOCKMOVE(SSEG%, SOFF%, DSEG%, DOFF%, WordsToMove%)
SHADOW.OBJ - Makes the Menu Shadows. Syntax is;
SHADOW Row%, Column%, Wide%, High%, Attribute%
or
CALL SHADOW(Row%, Column%, Wide%, High%, Attribute%)
BITS.OBJ - Bit information extractor for integers in QuickBASIC.
Syntax is;
a% = BITS(Number%, MSB%, LSB%)
MSB% and LSB% should never exceed 15 or be less than 0.
LSB should never be greater than MSB.
Whenever MSB% = LSB%, BITS returns either a 1 or a 0.
Whenever MSB% > LSB%, BITS returns the value of that range
of BITS.
A% = BITS(&HFFFF, 3, 0) would return &HF, or 15 for A%
A% = BITS(&HFFFF, 0, 0) would return &H1, or 1 for A%
A% = BITS(&HFFFF, 7, 4) would return &HF, or 15 for A%
BITS is a FUNCTION. It is not used in any of the code
produced by BMW.EXE and is included for those who weary
of figuring out hex mask. Something to tinker with.
The code produced by BMW.EXE makes heavy use of COMMON SHARED variables.
If you want to add to the list of COMMON BLOCK variables, do so via the
an INCLUDE file, like BARMENU.BI, as the manual recommends. Since these
are global variables, you should be aware of their names to avoid using
the same names for variables used for another purpose.
The Toggle feature that you can assign to a menu selection with the '*'
character establishes the value of an element in a global integer array.
The idea is for your program to behave differently depending on the
value of this variable.
As more features were added to the source code, I decided to leave some of
them out of the behavior of BMW.EXE when it is just running an input file,
to keep the size of the executable down. You will find that the best way to
check out your Bar Menu's is to go ahead and let BARBCOM.BAT or BARBRUN.BAT
create TEST.EXE. The behavior of the menus in in this case is what they'll
be when you create an EXE file.
7. Feedback
In addition to the Mouse code the next version of BMW.EXE will generate,
a mechanism for generating pop-up menus is being incorporated.
Currently, I am considering two methods for getting the information needed
by BMW.EXE when it goes to write a popmenu that is a logical extension of
a Dropmenu.
Possibility #1:
File DropMenu1 DropMenu2 DropMenu3 DropMenu4 DropMenu5
File Selection_1... Selection_2 Selection_3 Selection_4 Selection_5
DropMenu1 Selection_1 Selection_2 Selection_3 Selection_4 Selection_5
DropMenu2 Selection_1 Selection_2 Selection_3 Selection_4 Selection_5
DropMenu3 Selection_1... Selection_2 Selection_3 Selection_4 Selection_5
DropMenu4 Selection_1 Selection_2 Selection_3 Selection_4 Selection_5
DropMenu5 Selection_1 Selection_2 Selection_3 Selection_4 Selection_5
'$POPMENU
PopUpMenu1 DoThis DoThat DoWhatever
PopUpMenu2 DoThis DoThat DoWhatever
In this input file, I thought that the three periods under File, Selection_1,
would be an indicator to BMW.EXE to read the first line after an imbedded
metacommand such as '$POPMENU, where '$POPMENU is the beginning of
pop up description text. The next time BMW.EXE sees a "..." it knows to
read the next line, which is PopUpMenu2.
Possibility #2:
Use the "..." or some other notation to clue BMW to read in a separate file
that describes the popmenu, or a particular line in a separate file that
describes the popmenu[s].
Perhaps you have a prefered method. Let me know!
This is my checklist for improvements to make to BMW.EXE:
1. Add mouse code
2. Add PopMenu Code
3. Add SoftKey Input Screen Code
4. Add command line argument that tells BMW.EXE to read in other files
and build them into the libraries. Saves editing time.
5. Dump built in code for parsing the command line and write the code
that deciphers the commands
6. Use environment variables for BMW.EXE to tell it where to look for
input files and other files, and to tell BMW.EXE what other built
in handy subroutines and functions to Dump along with the Bar/Drop/Pop
Menus.
7. Generate MAK files for MAKE.EXE, faster than BATCH Files
8. Your ideas!
In the end, I want to see hours or even days worth of work shortened to
minutes, and to be able to develope a user friendly program on very short
notice.